<?php

namespace app\noLogin\controller;
use app\BaseController;
use app\common\model\UserModel;
use app\common\util\SmsCode\impl\TestSmsCodeCodeImpl;
use think\App;

class Login extends BaseController
{
    protected $userModel;

    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->userModel = new UserModel();
    }

    public function login_do()
    {
        $account = request()->param("account")??request()->param("mobile")??request()->param("username");
        $password = request()->param("password");
        $login_do = $this->userModel->login_do($account, $password);
        return R($login_do, $login_do, $this->userModel->getErr());
    }
    public function send_sms(){
        $mobile = request()->param("mobile");
        $rsData=TestSmsCodeCodeImpl::send($mobile,"login");
        return R($rsData);
    }
}